sb_tweets <- read_sf("data/sb-tweets.shp")
head(sb_tweets)
## Simple feature collection with 6 features and 6 fields
## geometry type: POINT
## dimension: XY
## bbox: xmin: -119.8908 ymin: 34.42285 xmax: -119.632 ymax: 34.4337
## epsg (SRID): 4326
## proj4string: +proj=longlat +datum=WGS84 +no_defs
## # A tibble: 6 x 7
## Month Day Year fll_txt usr_lct usr_typ geometry
## <chr> <dbl> <dbl> <chr> <chr> <chr> <POINT [°]>
## 1 Nov 29 2019 "santa maria styl~ 805 tourist (-119.714 34.4258)
## 2 Nov 29 2019 "?well she's wash~ world w~ tourist (-119.632 34.4337)
## 3 Nov 29 2019 "i pray everyone ~ Chicago~ tourist (-119.632 34.4337)
## 4 Nov 30 2019 ".\nlet my speech~ Santa B~ local (-119.8908 34.42285)
## 5 Nov 30 2019 "#paleo #bananacr~ Santa B~ local (-119.714 34.4258)
## 6 Nov 29 2019 "only family phot~ Califor~ tourist (-119.714 34.4258)
mapview(sb_tweets)
Play with some color
mapview(sb_tweets, zcol = "usr_typ")
Can also map continuous data
mapview(sb_tweets, zcol = "Day")
#cpad = california protected area database
cpad <- read_sf("data/ca_protected_areas.shp")
#zcol allows you to symbolize based on a field,
# burst allows you to separate into separate layers
mapview(cpad, zcol = "ACCESS_TYP", burst = TRUE)
Apply your own colors using col.regions
# mapview(cpad, zcol = "ACCESS_TYP", col.regions = c("purple","yellow","darkgreen","orange"))
mapview(cpad, zcol = "ACCESS_TYP", col.regions = mapviewPalette("mapviewSpectralColors"))